package com.openxt.nbzj.model;

import android.content.Context;

import com.alibaba.fastjson.JSONObject;
import com.openxt.nbzj.push.Push;
import com.openxt.nbzj.remoting.ClientEx;
import com.openxt.nbzj.remoting.RemotingEx;
import com.openxt.nbzj.util.SystemUtil;

import qs.openxt.libs.util.ActivityUtil;
import qs.openxt.libs.util.StringUtil;
import qs.openxt.libs.util.Utils;

/**
 * Created by 颖杰_2 on 2016/7/7.
 */
public class RemotingModel {
    /**
     * 服务地址
     */
    public final static String SERVERURL = "http://115.238.132.44:81/yczjapi";

    /**
     * 天气接口
     */
    public final static String WEATHER_GETWEATHER = "/weather/GetWeather";

    /**
     * 拥堵指数接口
     */
    public final static String WEATHER_GETTRAFFICJAM = "/weather/GetTrafficJam";

    /***热点新闻*/
    public final static String NEWS_GETHOT = "/News/GetNativeHot";
    /***活动图片*/
    public final static String ACTIVITY_GET = "/Activity/Get";
    /***订阅-未登录*/
    public final static String SUBSCRIBE_GETNATIVEDEFAULT = "/Subscribe/GetNativeDefault";
    /***订阅-已登录*/
    public final static String SUBSCRIBE_GETNATIVESUBSCRIBED = "/Subscribe/GetNativeSubscribed";

    /***登录*/
    public final static String LOGIN_NATIVE = "/customer/{account}/{pwd}Login_Native";

    /**
     * 专题
     */
    public final static String SPECIAL_GET_NATIVE = "/Special/Get_Native";

    /**
     * 订阅提交
     */
    public final static String SUBSCRIBE_SUBMIT = "/Subscribe/Submit";

    /**
     * 获取新闻类型
     */
    public final static String NEWS_GETALLNEWSTYPE = "/News/GetAllNewsType";
    /**
     * 获取新闻大图数据
     */
    public final static String NEWS_GETNATIVECATEGORYBIGIMG = "/News/GetNativeCategoryBigImg";
    /**
     * 获取新闻数据
     */
    public final static String NEWS_GETNATIVECATEGORYDATANEW = "/News/GetNativeCategoryData";
    /**
     * 获取新闻数据
     */
    public final static String NEWS_GETNATIVEFINDNEWS = "/News/GetNativeFindNews";

    /**
     * 企业资质
     */
    public final static String ENTERPRISE_GETNATIVE = "/Enterprise/GetNative";
    /**
     * 企业信用
     */
    public final static String ENTERPRISE_GETNATIVE_CREDIT = "/Enterprise/GetNative_Credit";
    /**
     * 企业信用分页
     */
    public final static String ENTERPRISE_GETPAGENATIVE_CREDIT = "/enterprise/GetPageNative_Credit";
    /**
     * 企业信用分类
     */
    public final static String ENTERPRISE_GETALLENTTYPE = "/enterprise/GetAllEntType";
    /**
     * 企业信用详情
     */
    public final static String ENTERPRISE_GETCREDIT_DETAIL = "/enterprise/GetCredit_Detail";

    /**
     * 项目信息
     */
    public final static String PROJECT_GETNATIVE = "/Project/GetNative";

    /**
     * 获取版本更新
     */
    public final static String CHECKVERSION = "/CheckVersion/CheckVersion";

    /**
     * 房屋巡查
     */
    public final static String HOUSEPATROL_GETPATROLTASK_NATIVE = "/HousePatrol/GetPatrolTask_Native";

    /**
     * 通知公告
     */
    public final static String NOTICE_GETNATIVE = "/Notice/GetNative";
    /**
     * 公告收藏
     */
    public final static String NOTICE_GETNATIVECOLLECT = "/Notice/GetNative_Collect";
    /**
     * 企业资质详情
     */
    public final static String ENTERPRISE_GETINFO = "/Enterprise/Getinfo";
    /**
     * 项目详情
     */
    public final static String PROJECT_GETINFO = "/Project/Getinfo";

    /**
     * 建委公文
     */
    public final static String PUSHNOTICE_GETNATIVEPAGEPUSHNOTICE = "/PushNotice/GetNativePagePushNotice";
    /**
     * 建委公文详情
     */
    public final static String PUSHNOTICE_GETPUSHNOTICE = "/PushNotice/GetPushNotice";
    /**
     * 建委公文详情状态
     */
    public final static String PUSHNOTICE_HASREAD = "/PushNotice/HasRead";

    /**
     * 心跳
     */
    public final static String HEARTBEAT_CALL = "/HeartBeat/Call";
    /**
     * 页面访问量统计
     */
    public final static String ACCESSSTATISTICS_CALL = "/AccessStatistics/Call";
    /**
     * 通知公告详情
     */
    public final static String NOTICE_GET = "/Notice/Get";
    /**
     * 通知公告详情-获取是否收藏
     */
    public final static String NOTICE_GETCOLLECT = "/Notice/GetCollect";
    /**
     * 通知公告详情-取消收藏
     */
    public final static String NOTICE_DELCOLLECT = "/Notice/DelCollect";
    /**
     * 通知公告详情-添加收藏
     */
    public final static String NOTICE_COLLECTIONNOTICE = "/Notice/CollectionNotice";

    /**
     * 修改头像
     */
    public final static String CUSTOMER_UPTIMAGE = "/Customer/UptImage";
    /**
     * 修改昵称
     */
    public final static String CUSTOMER_UPDATENICKNAME = "/customer/UpdateNickName";

    private Context mContext = null;

    public RemotingModel() {
    }

    public RemotingModel(Context context) {
        this.mContext = context;
    }

    /***
     * 判断是否登录
     * @return
     */
    public static boolean isLogin() {
        return !StringUtil.isNull(ClientEx.CUSTOMERID);
    }

    /**
     * 获取天气
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getWeatherGetWeather(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.WEATHER_GETWEATHER);
        remoting.setServerAddress(SERVERURL + WEATHER_GETWEATHER);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 获取拥堵指数
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getWeatherGettrafficjam(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.WEATHER_GETTRAFFICJAM);
        remoting.setServerAddress(SERVERURL + WEATHER_GETTRAFFICJAM);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 获取热点新闻
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNewsGethot(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NEWS_GETHOT);
        remoting.setServerAddress(SERVERURL + NEWS_GETHOT);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 获取活动图片
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getActivityGet(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ACTIVITY_GET);
        remoting.setServerAddress(SERVERURL + ACTIVITY_GET);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 登录
     *
     * @param usename
     * @param password
     * @param listener
     * @param showDialogProgress
     */
    public void login(String usename, String password, RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.LOGIN_NATIVE);
        String url = LOGIN_NATIVE;
        url = url.replace("{account}", usename).replace("{pwd}", password);
        String channelId = Utils.getLocalStorage(mContext, Push.PUSH_CHANNELID);
        remoting.setServerAddress(SERVERURL + url + "?chennelID=" + channelId);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject dec = SystemUtil.getDevice(mContext);
        JSONObject param = new JSONObject();
        JSONObject data = new JSONObject();
        data.put("Account", usename);
        data.put("Pwd", password);
        data.put("IMEI", dec.getString("IMEI"));
        data.put("Name", dec.getString("PhoneName"));
        data.put("Type", dec.getString("PhoneType"));
        param.put("data", data);
        remoting.doRequest(param, "POST");
    }

    /**
     * 获取专题
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getSpecialGetNative(RemotingEx.OnActionListener listener, boolean showDialogProgress, int pageIndex, int pageSize, String make, Long timeStamp) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.SPECIAL_GET_NATIVE + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + SPECIAL_GET_NATIVE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        JSONObject data = new JSONObject();
        data.put("pageIndex", pageIndex);
        data.put("pageSize", pageSize);
        data.put("timeStamp", StringUtil.isNull(timeStamp) ? "" : timeStamp);
        param.put("data", data);
        remoting.doRequest(param, "GET");
    }

    /**
     * 获取通知公告
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeGetNative(RemotingEx.OnActionListener listener, boolean showDialogProgress, int pageIndex, int pageSize, String make, Long timeStamp) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_GETNATIVE + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + NOTICE_GETNATIVE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        JSONObject data = new JSONObject();
        data.put("pageIndex", pageIndex);
        data.put("pageSize", pageSize);
        data.put("timeStamp", StringUtil.isNull(timeStamp) ? "" : timeStamp);
        param.put("data", data);
        remoting.doRequest(param, "GET");
    }

    /**
     * 获取公告收藏
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeGetNativeCollect(RemotingEx.OnActionListener listener, boolean showDialogProgress, int pageIndex, int pageSize, String make, Long timeStamp) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_GETNATIVECOLLECT + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + NOTICE_GETNATIVECOLLECT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        JSONObject data = new JSONObject();
        data.put("pageIndex", pageIndex);
        data.put("pageSize", pageSize);
        data.put("timeStamp", StringUtil.isNull(timeStamp) ? "" : timeStamp);
        param.put("data", data);
        remoting.doRequest(param, "GET");
    }

    /**
     * 订阅提交
     *
     * @param listener
     * @param showDialogProgress
     * @param list
     */
    public void doSbscribeSubmit(RemotingEx.OnActionListener listener, boolean showDialogProgress, String list) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.SUBSCRIBE_SUBMIT);
        remoting.setServerAddress(SERVERURL + SUBSCRIBE_SUBMIT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        JSONObject data = new JSONObject();
        data.put("strSubscribe", list);
        param.put("data", data);
        remoting.doRequest(param, "POST");
    }

    /**
     * 获取新闻类型
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doNewsGetallnewstype(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NEWS_GETALLNEWSTYPE);
        remoting.setServerAddress(SERVERURL + NEWS_GETALLNEWSTYPE);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 获取新闻大图
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNewsGetnativecategorybigimg(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NEWS_GETNATIVECATEGORYBIGIMG);
        remoting.setServerAddress(SERVERURL + NEWS_GETNATIVECATEGORYBIGIMG);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取新闻数据
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNewsGetnativecategorydata(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NEWS_GETNATIVECATEGORYDATANEW + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + NEWS_GETNATIVECATEGORYDATANEW);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取新闻数据
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNewsGetnativefindnews(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NEWS_GETNATIVEFINDNEWS + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + NEWS_GETNATIVEFINDNEWS);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取企业资质
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getEnterpriseGetnative(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETNATIVE + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETNATIVE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取企业信用
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getEnterpriseGetnativeCredit(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETNATIVE_CREDIT + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETNATIVE_CREDIT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取企业信用分页
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getEnterpriseGetPageNativeCredit(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETPAGENATIVE_CREDIT + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETPAGENATIVE_CREDIT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取企业信用分类
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getEnterpriseGetallenttype(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETALLENTTYPE);
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETALLENTTYPE);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 获取项目信息
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getProjectGetNative(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.PROJECT_GETNATIVE + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + PROJECT_GETNATIVE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取版本更新
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getCheckVersion(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.CHECKVERSION);
        remoting.setServerAddress(SERVERURL + CHECKVERSION);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        JSONObject param = new JSONObject();
        param.put("type", "android");
        param.put("Version", ActivityUtil.getVersion(mContext));
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取房屋巡查
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getHousepatrolGetpatroltaskNative(RemotingEx.OnActionListener listener, boolean showDialogProgress) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.HOUSEPATROL_GETPATROLTASK_NATIVE);
        remoting.setServerAddress(SERVERURL + HOUSEPATROL_GETPATROLTASK_NATIVE);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 页面访问量统计
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doAccessStatisticsCall(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ACCESSSTATISTICS_CALL);
        remoting.setServerAddress(SERVERURL + ACCESSSTATISTICS_CALL);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "POST");
    }

    /**
     * 心跳
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doHeartbeatCall(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.HEARTBEAT_CALL);
        remoting.setServerAddress(SERVERURL + HEARTBEAT_CALL);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "POST");
    }

    /**
     * 企业资质详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doEnterpriseGetinfo(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETINFO + "$" + ID);
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETINFO + "/" + ID);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 企业信用详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doEnterpriseGetcreditDetail(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.ENTERPRISE_GETCREDIT_DETAIL + "$" + ID);
        remoting.setServerAddress(SERVERURL + ENTERPRISE_GETCREDIT_DETAIL + "/" + ID);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 项目详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doProjectGetinfo(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.PROJECT_GETINFO + "$" + ID);
        remoting.setServerAddress(SERVERURL + PROJECT_GETINFO + "/" + ID);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 通知公告详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeGet(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_GET + "$" + ID);
        remoting.setServerAddress(SERVERURL + NOTICE_GET + "/" + ID);
        remoting.setShowDialogProgress(showDialogProgress);
        remoting.doRequest(null, "GET");
    }

    /**
     * 通知公告详情-获取是否收藏
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeGetCollect(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_GETCOLLECT);
        remoting.setServerAddress(SERVERURL + NOTICE_GETCOLLECT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("noticeid", ID);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 通知公告详情-取消收藏
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeDelCollect(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_DELCOLLECT);
        remoting.setServerAddress(SERVERURL + NOTICE_DELCOLLECT);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("noticeid", ID);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 通知公告详情-添加收藏
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getNoticeCollectionnotice(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.NOTICE_COLLECTIONNOTICE);
        remoting.setServerAddress(SERVERURL + NOTICE_COLLECTIONNOTICE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("noticeid", ID);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 修改头像
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doCustomerUptImage(RemotingEx.OnActionListener listener, boolean showDialogProgress, String url) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.CUSTOMER_UPTIMAGE + "$" + url);
        remoting.setServerAddress(SERVERURL + CUSTOMER_UPTIMAGE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("url", url);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 修改昵称
     *
     * @param listener
     * @param showDialogProgress
     */
    public void doCustomerUpdatenickname(RemotingEx.OnActionListener listener, boolean showDialogProgress, String nikename) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.CUSTOMER_UPDATENICKNAME + "$" + nikename);
        remoting.setServerAddress(SERVERURL + CUSTOMER_UPDATENICKNAME);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("nikename", nikename);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取建委公文
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getPushnoticeGetnativepagepushnotice(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param, String make) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.PUSHNOTICE_GETNATIVEPAGEPUSHNOTICE + (StringUtil.isNull(make) ? "" : make));
        remoting.setServerAddress(SERVERURL + PUSHNOTICE_GETNATIVEPAGEPUSHNOTICE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取建委公文详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getPushnoticeGetpushnotice(RemotingEx.OnActionListener listener, boolean showDialogProgress, String ID) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.PUSHNOTICE_GETPUSHNOTICE + "$" + ID);
        remoting.setServerAddress(SERVERURL + PUSHNOTICE_GETPUSHNOTICE);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject param = new JSONObject();
        param.put("ID", ID);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }

    /**
     * 获取建委公文详情
     *
     * @param listener
     * @param showDialogProgress
     */
    public void getPushnoticeHasread(RemotingEx.OnActionListener listener, boolean showDialogProgress, JSONObject param) {
        RemotingEx remoting = new RemotingEx(mContext, listener, ConfigModel.PUSHNOTICE_HASREAD);
        remoting.setServerAddress(SERVERURL + PUSHNOTICE_HASREAD);
        remoting.setShowDialogProgress(showDialogProgress);
        JSONObject data = new JSONObject();
        data.put("data", param);
        remoting.doRequest(data, "GET");
    }
}
